<?php

class Core_Action_Admin_System_Mail_Queue_Index extends Action_Admin
{

	public function execute($request, $initial = FALSE, $scritp = NULL)
	{
		if ($initial)
		{
			Agilet::setVar('breadcrum', array(
				array(
					'url' => 'admin/system',
					'label' => 'System'
				),
				array(
					'url' => 'admin/system/mail',
					'label' => 'Mail'
				),
				array(
					'url' => 'admin/system/mail/queue',
					'label' => 'Queue'
				)
			));
		}

		$table = Model::getTable('core/mail/queue');

		$select = $table -> select();
		
		$items = $table -> fetchAll($select);

		$request -> response = View::render($script = 'core/html/admin/system/mail/queue/index', $data = array('items' => $items));
	}

}
